var t = getApp();

Page({
    data: {
        active: 1,
        vanTab: [ {
            title: "分享补贴",
            id: 1
        }, {
            title: "发放明细",
            id: 2
        } ],
        dataList: [],
        infoList: {},
        page: 1,
        finished: !1
    },
    onLoad: function(t) {
        this.getData();
    },
    getData: function() {
        var a = this;
        if (!this.data.finished) {
            var e = 1 == this.data.active ? t.getNetAddresss("plugin.share-value.frontend.controllers.rewards.index") : t.getNetAddresss("plugin.share-value.frontend.controllers.give.index");
            t._getNetWork({
                url: e,
                data: {
                    page: this.data.page
                },
                success: function(t) {
                    if (1 !== t.data.result) return wx.showToast({
                        title: t.data.msg
                    }), !1;
                    var e, i = t.data.data, s = !1;
                    (0 === i.list.data.length || i.list.data.length < i.list.per_page || i.list.current_page === i.list.last_page) && (s = !0), 
                    e = a.data.dataList.concat(i.list.data), a.setData({
                        finished: s,
                        dataList: e,
                        infoList: i.info,
                        page: ++a.data.page
                    }), wx.setNavigationBarTitle({
                        title: i.info.name
                    });
                }
            });
        }
    },
    onReachBottom: function() {
        this.getData();
    },
    changeTabs: function(t) {
        this.setData({
            page: 1,
            finished: !1,
            active: t.detail.name,
            dataList: []
        }), this.getData();
    }
});